import request from "@/request"

export function getArticles(page) {
    return request({
        method: 'post',
        url: '/articles',
        data: page
    })

}
export function getHotArticles() {
    return request({
        url: '/articles/hot',
        method: 'post'
    })
}

export function getNewArticles() {
    return request({
        url: '/articles/new',
        method: 'post'
    })
}

export function getArchives() {
    return request({
        url: '/articles/listArchives',
        method: 'post'
    })
}

//获取文章详情
export function viewArticle(id) {
    return request({
        url: `/articles/view/${id}`,
        method: 'post'
    })
}


// export function getArticleById(id) {
//     return request({
//         url: `/articles/${id}`,
//         method: 'post'
//     })
// }
